//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_MMU_H__
#define __ELASTOS_MMU_H__

#define KERNEL_BASE ((virtaddr_t)KCONFIG_KERNEL_BASE)

#define MEMORY_MAPPED_IO_BASE   ((virtaddr_t)KCONFIG_MEMORY_MAPPED_IO_BASE)

#define PHYSADDR(va) \
    ((physaddr_t)(va) - (offset_t)KERNEL_BASE + (offset_t)bsp.paKernelPhysBase)

#define VIRTADDR(pa) \
    ((virtaddr_t)((uint_t)(pa) - bsp.paKernelPhysBase + (offset_t)KERNEL_BASE))

#define __PA(va)        PHYSADDR(va)

#define __VA(pa)        VIRTADDR(pa)

#include <ddk/hal/arm/paging.h>

#endif //__ELASTOS_MMU_H__
